Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13378cad authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Change rt->rt_iif encoding.



On input packet processing, rt->rt_iif will be zero if we should
use skb->dev->ifindex.

Since we access rt->rt_iif consistently via inet_iif(), that is
the only spot whose interpretation have to adjust.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b6858177
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -277,7 +277,11 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable


static inline int inet_iif(const struct sk_buff *skb)
static inline int inet_iif(const struct sk_buff *skb)
{
{
	return skb_rtable(skb)->rt_iif;
	int iif = skb_rtable(skb)->rt_iif;

	if (iif)
		return iif;
	return skb->skb_iif;
}
}


extern int sysctl_ip_default_ttl;
extern int sysctl_ip_default_ttl;
+4 −4
Original line number Original line Diff line number Diff line
@@ -1309,7 +1309,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
	rth->rt_flags	= RTCF_MULTICAST;
	rth->rt_flags	= RTCF_MULTICAST;
	rth->rt_type	= RTN_MULTICAST;
	rth->rt_type	= RTN_MULTICAST;
	rth->rt_is_input= 1;
	rth->rt_is_input= 1;
	rth->rt_iif	= dev->ifindex;
	rth->rt_iif	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_gateway	= 0;
	rth->rt_gateway	= 0;
	if (our) {
	if (our) {
@@ -1435,7 +1435,7 @@ static int __mkroute_input(struct sk_buff *skb,
	rth->rt_flags = flags;
	rth->rt_flags = flags;
	rth->rt_type = res->type;
	rth->rt_type = res->type;
	rth->rt_is_input = 1;
	rth->rt_is_input = 1;
	rth->rt_iif 	= in_dev->dev->ifindex;
	rth->rt_iif 	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_gateway	= 0;
	rth->rt_gateway	= 0;


@@ -1608,7 +1608,7 @@ out: return err;
	rth->rt_flags 	= flags|RTCF_LOCAL;
	rth->rt_flags 	= flags|RTCF_LOCAL;
	rth->rt_type	= res.type;
	rth->rt_type	= res.type;
	rth->rt_is_input = 1;
	rth->rt_is_input = 1;
	rth->rt_iif	= dev->ifindex;
	rth->rt_iif	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_gateway	= 0;
	rth->rt_gateway	= 0;
	if (res.type == RTN_UNREACHABLE) {
	if (res.type == RTN_UNREACHABLE) {
@@ -1772,7 +1772,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
	rth->rt_flags	= flags;
	rth->rt_flags	= flags;
	rth->rt_type	= type;
	rth->rt_type	= type;
	rth->rt_is_input = 0;
	rth->rt_is_input = 0;
	rth->rt_iif	= orig_oif ? : dev_out->ifindex;
	rth->rt_iif	= orig_oif ? : 0;
	rth->rt_pmtu	= 0;
	rth->rt_pmtu	= 0;
	rth->rt_gateway = 0;
	rth->rt_gateway = 0;