ip_fastfwd: style(9) tidy for r367628

Discussed with:	gnn
MFC with:	r367628
This commit is contained in:
Ed Maste 2020-11-13 18:25:07 +00:00
parent 0e0457251b
commit 360d1232ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367645
2 changed files with 6 additions and 5 deletions

View File

@ -131,17 +131,18 @@ ip_redir_alloc(struct mbuf *m, struct nhop_object *nh,
*/
m_free(mcopy);
return (NULL);
}
}
mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy));
mcopy->m_pkthdr.len = mcopy->m_len;
m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
if (nh != NULL &&
((nh->nh_flags & (NHF_REDIRECT|NHF_DEFAULT)) == 0)) {
struct in_ifaddr *nh_ia = (struct in_ifaddr *)(nh->nh_ifa);
u_long src = ntohl(ip->ip_src.s_addr);
if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) {
if (nh_ia != NULL &&
(src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) {
if (nh->nh_flags & NHF_GATEWAY)
*addr = nh->gw4_sa.sin_addr.s_addr;
else

View File

@ -111,7 +111,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW
&VNET_NAME(ipforwarding), 0,
"Enable IP forwarding between interfaces");
/*
/*
* Respond with an ICMP host redirect when we forward a packet out of
* the same interface on which it was received. See RFC 792.
*/