Reputation: 199
In Linux kernel 2.4.18, the network layer representation of the socket which is the sock struct has fields such as saddr
, sport
, daddr
, dport
, which represent the source and destination IP address (port). However, in kernel 2.6.18 these fields have been removed. I am trying to modify a module based on 2.4.18 kernel, does anyone know where these fields are saved in the networking stack?
Upvotes: 2
Views: 357
Reputation: 8851
I think you need to cast your struct sock to a struct inet_sock...
struct inet_sock *inet;
inet = inet_sk(sock);
inet->daddr, inet->dport, etc.
Upvotes: 2