if_ixl.c (ba76aa63573f4aeb8fbea6dc85548660cc6d083b) | if_ixl.c (ab43ce7a22690b66cf76f0d8e70d538442657077) |
---|---|
1/****************************************************************************** 2 3 Copyright (c) 2013-2018, Intel Corporation 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 --- 1610 unchanged lines hidden (view full) --- 1619 1620static int 1621ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) 1622{ 1623 struct ixl_pf *pf = iflib_get_softc(ctx); 1624 struct ifdrv *ifd = (struct ifdrv *)data; 1625 int error = 0; 1626 | 1/****************************************************************************** 2 3 Copyright (c) 2013-2018, Intel Corporation 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 --- 1610 unchanged lines hidden (view full) --- 1619 1620static int 1621ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) 1622{ 1623 struct ixl_pf *pf = iflib_get_softc(ctx); 1624 struct ifdrv *ifd = (struct ifdrv *)data; 1625 int error = 0; 1626 |
1627 /* NVM update command */ 1628 if (ifd->ifd_cmd == I40E_NVM_ACCESS) 1629 error = ixl_handle_nvmupd_cmd(pf, ifd); 1630 else 1631 error = EINVAL; | 1627 /* 1628 * The iflib_if_ioctl forwards SIOCxDRVSPEC and SIOGPRIVATE_0 without 1629 * performing privilege checks. It is important that this function 1630 * perform the necessary checks for commands which should only be 1631 * executed by privileged threads. 1632 */ |
1632 | 1633 |
1634 switch(command) { 1635 case SIOCGDRVSPEC: 1636 case SIOCSDRVSPEC: 1637 /* NVM update command */ 1638 if (ifd->ifd_cmd == I40E_NVM_ACCESS) { 1639 error = priv_check(curthread, PRIV_DRIVER); 1640 if (error) 1641 break; 1642 error = ixl_handle_nvmupd_cmd(pf, ifd); 1643 } else { 1644 error = EINVAL; 1645 } 1646 break; 1647 default: 1648 error = EOPNOTSUPP; 1649 } 1650 |
|
1633 return (error); 1634} 1635 1636static u_int 1637ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) 1638{ 1639 struct ixl_vsi *vsi = arg; 1640 --- 53 unchanged lines hidden --- | 1651 return (error); 1652} 1653 1654static u_int 1655ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) 1656{ 1657 struct ixl_vsi *vsi = arg; 1658 --- 53 unchanged lines hidden --- |