diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-06-10 21:39:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-10 21:39:35 +0200 |
commit | ce4a7d0d48bbaed78ccbb0bafb9229651a40303a (patch) | |
tree | df8770ef69c71a0d6935154add3ff3f4bb8dbc3a /include/net/inet_sock.h | |
parent | ipv4: Remove unused declaration from include/net/tcp.h. (diff) | |
download | linux-ce4a7d0d48bbaed78ccbb0bafb9229651a40303a.tar.xz linux-ce4a7d0d48bbaed78ccbb0bafb9229651a40303a.zip |
inet{6}_request_sock: Init ->opt and ->pktopts in the constructor
Wei Yongjun noticed that we may call reqsk_free on request sock objects where
the opt fields may not be initialized, fix it by introducing inet_reqsk_alloc
where we initialize ->opt to NULL and set ->pktopts to NULL in
inet6_reqsk_alloc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r-- | include/net/inet_sock.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a42cd63d241a..9fabe5b38912 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -197,4 +197,14 @@ static inline int inet_iif(const struct sk_buff *skb) return skb->rtable->rt_iif; } +static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops) +{ + struct request_sock *req = reqsk_alloc(ops); + + if (req != NULL) + inet_rsk(req)->opt = NULL; + + return req; +} + #endif /* _INET_SOCK_H */ |