2.6 X.25: When receiving a call, check listening sockets for matching call user data.
Subsystems (2)
PATCH 1/1 2.6 X.25: When receiving a call, check listening sockets for matching call user data.
If a listening socket sets call user data, ensure it only receives calls with matching call user data. Also ensure incoming calls with matching call user data dont go to another listening socket.
Signed-off-by Andrew Hendry <[email protected]>
include/net/x25.h +1 -0
@@ -243,6 +243,7 @@ extern int x25_validate_nr(struct sockextern void x25_write_internal (struct sock *,int );extern int x25_decode (struct sock *,struct sk_buff *,int *,int *,int *,int *,int *);extern void x25_disconnect (struct sock *,int ,unsigned char ,unsigned char ); +extern int x25_check_calluserdata (struct x25_calluserdata *,struct x25_calluserdata *);/* x25_timer.c */ extern void x25_start_heartbeat (struct sock *);
net/x25/af_x25.c +47 -15
109 lines not on this page · raw message
net/x25/x25_subr.c +19 -0
@@ -367,3 +367,22 @@ void x25_check_rbuf(struct sock *sk)x25_stop_timer (sk); } } + +/* +* Compare 2 calluserdata structures, used to find correct listening sockets +* when call user data is used. +*/ +int x25_check_calluserdata (struct x25_calluserdata *ours,struct x25_calluserdata *theirs) +{ +int i; +if (ours->cudlength != theirs->cudlength) +return 0 ; + +for (i=0 ;i<ours->cudlength;i++) { +if (ours->cuddata[i] != theirs->cuddata[i]) { +return 0 ; + } + } +return 1 ; +} +