Commit 33e93ed2 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: add skb_sdif in struct sctp_af

Add skb_sdif function in struct sctp_af to get the enslaved device
for both ipv4 and ipv6 when adding SCTP VRF support in sctp_rcv in
the next patch.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f87b1ac0
...@@ -477,6 +477,7 @@ struct sctp_af { ...@@ -477,6 +477,7 @@ struct sctp_af {
int (*available) (union sctp_addr *, int (*available) (union sctp_addr *,
struct sctp_sock *); struct sctp_sock *);
int (*skb_iif) (const struct sk_buff *sk); int (*skb_iif) (const struct sk_buff *sk);
int (*skb_sdif)(const struct sk_buff *sk);
int (*is_ce) (const struct sk_buff *sk); int (*is_ce) (const struct sk_buff *sk);
void (*seq_dump_addr)(struct seq_file *seq, void (*seq_dump_addr)(struct seq_file *seq,
union sctp_addr *addr); union sctp_addr *addr);
......
...@@ -842,7 +842,12 @@ static int sctp_v6_addr_to_user(struct sctp_sock *sp, union sctp_addr *addr) ...@@ -842,7 +842,12 @@ static int sctp_v6_addr_to_user(struct sctp_sock *sp, union sctp_addr *addr)
/* Where did this skb come from? */ /* Where did this skb come from? */
static int sctp_v6_skb_iif(const struct sk_buff *skb) static int sctp_v6_skb_iif(const struct sk_buff *skb)
{ {
return IP6CB(skb)->iif; return inet6_iif(skb);
}
static int sctp_v6_skb_sdif(const struct sk_buff *skb)
{
return inet6_sdif(skb);
} }
/* Was this packet marked by Explicit Congestion Notification? */ /* Was this packet marked by Explicit Congestion Notification? */
...@@ -1142,6 +1147,7 @@ static struct sctp_af sctp_af_inet6 = { ...@@ -1142,6 +1147,7 @@ static struct sctp_af sctp_af_inet6 = {
.is_any = sctp_v6_is_any, .is_any = sctp_v6_is_any,
.available = sctp_v6_available, .available = sctp_v6_available,
.skb_iif = sctp_v6_skb_iif, .skb_iif = sctp_v6_skb_iif,
.skb_sdif = sctp_v6_skb_sdif,
.is_ce = sctp_v6_is_ce, .is_ce = sctp_v6_is_ce,
.seq_dump_addr = sctp_v6_seq_dump_addr, .seq_dump_addr = sctp_v6_seq_dump_addr,
.ecn_capable = sctp_v6_ecn_capable, .ecn_capable = sctp_v6_ecn_capable,
......
...@@ -567,6 +567,11 @@ static int sctp_v4_skb_iif(const struct sk_buff *skb) ...@@ -567,6 +567,11 @@ static int sctp_v4_skb_iif(const struct sk_buff *skb)
return inet_iif(skb); return inet_iif(skb);
} }
static int sctp_v4_skb_sdif(const struct sk_buff *skb)
{
return inet_sdif(skb);
}
/* Was this packet marked by Explicit Congestion Notification? */ /* Was this packet marked by Explicit Congestion Notification? */
static int sctp_v4_is_ce(const struct sk_buff *skb) static int sctp_v4_is_ce(const struct sk_buff *skb)
{ {
...@@ -1185,6 +1190,7 @@ static struct sctp_af sctp_af_inet = { ...@@ -1185,6 +1190,7 @@ static struct sctp_af sctp_af_inet = {
.available = sctp_v4_available, .available = sctp_v4_available,
.scope = sctp_v4_scope, .scope = sctp_v4_scope,
.skb_iif = sctp_v4_skb_iif, .skb_iif = sctp_v4_skb_iif,
.skb_sdif = sctp_v4_skb_sdif,
.is_ce = sctp_v4_is_ce, .is_ce = sctp_v4_is_ce,
.seq_dump_addr = sctp_v4_seq_dump_addr, .seq_dump_addr = sctp_v4_seq_dump_addr,
.ecn_capable = sctp_v4_ecn_capable, .ecn_capable = sctp_v4_ecn_capable,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment