Apply the MAC label to an outgoing UDP packet when other inpcb properties are
processed, meaning that we avoid the cost of MAC label assignment if we're going to drop the packet due to mbuf exhaustion, etc. MFC after: 3 weeks
This commit is contained in:
parent
f4841b5380
commit
1175d9d56d
@ -854,10 +854,6 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
|
||||
INP_RLOCK(inp);
|
||||
}
|
||||
|
||||
#ifdef MAC
|
||||
mac_inpcb_create_mbuf(inp, m);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If the IP_SENDSRCADDR control message was specified, override the
|
||||
* source address for this datagram. Its use is invalidated if the
|
||||
@ -968,6 +964,10 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
|
||||
if (inp->inp_flags & INP_ONESBCAST)
|
||||
ipflags |= IP_SENDONES;
|
||||
|
||||
#ifdef MAC
|
||||
mac_inpcb_create_mbuf(inp, m);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set up checksum and output datagram.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user