MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ifpromisc

Function ifpromisc

freebsd/net/if.c:3176–3190  ·  view source on GitHub ↗

* Set/clear promiscuous mode on interface ifp based on the truth value * of pswitch. The calls are reference counted so that only the first * "on" request actually has an effect, as does the final "off" request. * Results are undefined if the "off" and "on" requests are not matched. */

Source from the content-addressed store, hash-verified

3174 * Results are undefined if the "off" and "on" requests are not matched.
3175 */
3176int
3177ifpromisc(struct ifnet *ifp, int pswitch)
3178{
3179 int error;
3180 int oldflags = ifp->if_flags;
3181
3182 error = if_setflag(ifp, IFF_PROMISC, IFF_PPROMISC,
3183 &ifp->if_pcount, pswitch);
3184 /* If promiscuous mode status has changed, log a message */
3185 if (error == 0 && ((ifp->if_flags ^ oldflags) & IFF_PROMISC) &&
3186 log_promisc_mode_change)
3187 if_printf(ifp, "promiscuous mode %s\n",
3188 (ifp->if_flags & IFF_PROMISC) ? "enabled" : "disabled");
3189 return (error);
3190}
3191
3192/*
3193 * Return interface configuration

Callers 9

carp_alloc_ifFunction · 0.85
carp_free_ifFunction · 0.85
bridge_delete_memberFunction · 0.85
bridge_ioctl_addFunction · 0.85
bpf_detachd_lockedFunction · 0.85
bpfioctlFunction · 0.85
bpf_setdltFunction · 0.85
ng_ether_rcvmsgFunction · 0.85
ng_ether_shutdownFunction · 0.85

Calls 2

if_setflagFunction · 0.85
if_printfFunction · 0.85

Tested by

no test coverage detected