ip_srcroute function

When a response packet, ICMP, and standard transport layer protocol packet must be routed from any source with reversed. Reversal source
routing is through ip _ srcroute saved route structure.

777-- after 7 8 3 ip _ srcroute stored in the source routing ip _ srcrt structure reversed,
if ip _ nhops is 0, there is no saved routes, the
ip _ srcroute returns a pointer.
When an invalid packet arrives, ipintr the ip _ nhops cleared. The transport layer
protocol must call ip _ srcroute, and before the next packet arrives save your route after the reversal. Positive
as we previously noted, rightly so, because ipintr when processing packets in IP input queue of
the next packet is processed will be called before the transport layer (TCP or UDP) of.
Source routing cache memory allocated
784--786 if ip _ nhops non-0, ip _ srcroute the mbuf allocated a, and the m _ len set to be large enough
to contain a first hop destination option header information ( OPTSIZ) and routing after the reversal. If the allocation fails, it returns
a null pointer, with no source routing the same.
p is initialized to point reaches the end of the route, ip _ srcroute copied last recorded address to the front of mbuf,
where it began to reverse routing the first outgoing hop destination. The function then put a NOP option and
copy the source routing information to the mbuf.
8 0 5 - 8 1 8 W hile the rest of the cycle are copied from the source address of the IP route in a reverse order to the mbuf. Most routes
After an address is provided to save the packet reaches the RTE _ placed ip _ srcrt. Dst address of the source station. It returns a
pointer to the mbuf.

Guess you like

Origin www.cnblogs.com/momenglin/p/11518546.html