diff options
| author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2006-06-20 00:04:53 -0700 |
|---|---|---|
| committer | Chris Wright <chrisw@sous-sol.org> | 2006-06-29 17:17:15 -0700 |
| commit | 8cd8533a381af92ff3febeb0ab82b4d145be1257 (patch) | |
| tree | 29da9fab4d154975e3c7e01b2932fb3581c0d5a0 /net/sctp/protocol.c | |
| parent | 617495463a301a956990b87913849dd740e58bcf (diff) | |
[PATCH] SCTP: Reject sctp packets with broadcast addresses.
Make SCTP handle broadcast properly
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'net/sctp/protocol.c')
| -rw-r--r-- | net/sctp/protocol.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 2088aa992b7a..816c033d7886 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -365,12 +365,18 @@ static int sctp_v4_is_any(const union sctp_addr *addr) * Return 0 - If the address is a non-unicast or an illegal address. * Return 1 - If the address is a unicast. */ -static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_sock *sp) +static int sctp_v4_addr_valid(union sctp_addr *addr, + struct sctp_sock *sp, + const struct sk_buff *skb) { /* Is this a non-unicast address or a unusable SCTP address? */ if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) return 0; + /* Is this a broadcast address? */ + if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST) + return 0; + return 1; } |
