Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_input.c
| Show First 20 Lines • Show All 599 Lines • ▼ Show 20 Lines | #endif | ||||
| ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
| dchg = (odst.s_addr != ip->ip_dst.s_addr); | dchg = (odst.s_addr != ip->ip_dst.s_addr); | ||||
| ifp = m->m_pkthdr.rcvif; | ifp = m->m_pkthdr.rcvif; | ||||
| if (m->m_flags & M_FASTFWD_OURS) { | if (m->m_flags & M_FASTFWD_OURS) { | ||||
| m->m_flags &= ~M_FASTFWD_OURS; | m->m_flags &= ~M_FASTFWD_OURS; | ||||
| goto ours; | goto ours; | ||||
| } | } | ||||
| if (m->m_flags & M_IP_NEXTHOP) { | if (IP_HAS_NEXTHOP(m)) { | ||||
| if (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { | |||||
| /* | /* | ||||
| * Directly ship the packet on. This allows | * Directly ship the packet on. This allows | ||||
| * forwarding packets originally destined to us | * forwarding packets originally destined to us | ||||
| * to some other directly connected host. | * to some other directly connected host. | ||||
| */ | */ | ||||
| ip_forward(m, 1); | ip_forward(m, 1); | ||||
| return; | return; | ||||
franco_opnsense.org: This is an equivalent transformation, but maybe the second call can be omitted, as it doesn't… | |||||
Done Inline ActionsI think IP_HAS_NEXTHOP() is enough to check. ae: I think IP_HAS_NEXTHOP() is enough to check. | |||||
| } | |||||
| } | } | ||||
| passin: | passin: | ||||
| /* | /* | ||||
| * Process options and, if not destined for us, | * Process options and, if not destined for us, | ||||
| * ship it on. ip_dooptions returns 1 when an | * ship it on. ip_dooptions returns 1 when an | ||||
| * error was detected (causing an icmp message | * error was detected (causing an icmp message | ||||
| * to be sent and the original packet to be freed). | * to be sent and the original packet to be freed). | ||||
| ▲ Show 20 Lines • Show All 753 Lines • Show Last 20 Lines | |||||
This is an equivalent transformation, but maybe the second call can be omitted, as it doesn't read data and we are kind of enforcing consistency now with the functions itself?