Skip to contentSkip to conversation

question about netlink/rtnetlink sockets

DISCUSSION Christopher Friesen 1 participant 1 message Aug 30, 2001

lore
Share & tools
lore
#0 lore raw

I'm working on writing some code that talks to the kernel over a netlink socket and manipulates IP addresses, rules, and routes.

I've gotten it working, except for the case of adding an address that is already present. I would like to either ignore or replace it if it is already there (haven't decided which yet) but currently I get an EEXIST error. (Which is understandable, but I'd like to get rid of it.) I tried setting the NLM_F_REPLACE flag (which works when trying to add a route that already exists) but this didn't seem to do anything. Neither did NLM_F_EXCL.

Is this the expected behaviour? Is there some reason why we don't replace it with the newly specified address? If there is no serious reason, could you point me towards the code controlling this? I'm on 2.2.

Thanks,

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]