openwrt / odhcp6c

This repository is a mirror of https://git.openwrt.org/?p=project/odhcp6c.git. It is for reference only and is not active for checks-ins or reporting issues; issues should be reported at: https://bugs.openwrt.org. Pull requests will be accepted which will be merged in odhcp6c.git
GNU General Public License v2.0
78 stars 84 forks source link

odhcp6c with sigusr2 signal sends release but sends solicit message immediately #58

Closed mogulapranay-freescale closed 5 years ago

mogulapranay-freescale commented 5 years ago

udhcp v4 client works fine with release only issue with ipv6 odhcp6c

dedeckeh commented 5 years ago

That's the actual intended behavior of SIGUSR2; send a RELEASE and restart the state machine by sending SOLICIT messages

mogulapranay-freescale commented 5 years ago

Thanks for reply, if we want to release the IPv6 and don't send any solicit message just like ipv4 release, is there any option supports?

dedeckeh commented 5 years ago

Just bring down the wan6 interface and it will send a release?

mogulapranay-freescale commented 5 years ago

yes, bring down wan6 interface will release (if not using -k option) but i need same behavior of v4 (udhcp) without interface down.

dedeckeh commented 5 years ago

I don't understand your use case at all ... So you want to bring down the DHCPv6 state machine but you don't want to bring down the interface ... This will trigger anyway the script down action which will bring down the interface in netifd Either you've a funky requirement which you're not telling me or are you using the odhcp6c client on a non-OpenWrt environment ?

mogulapranay-freescale commented 5 years ago

My apologies for not mentioning my exact requirement clearly.

I am using openwrt environment, using udhcpc for ipv4 and odhcp6c for ipv6 as dhcp clients.

In IPv4 case : when I send sigusr2 signal for udhcpc (kill -s SIGUSR2 $pid_of_udhcpc), udhcpc releases ip and the interface is down (ifstatus wan2 shows up as false) but the udhcpc daemon will be still running for that interface. When i send renew(SIGUSR1 signal) the interface will be up because the udhcpc daemon is still running.

My requirement: Just like udhcpc, the odhcp6c daemon should be still be running for the interface even after releasing the IP, so that I can send renew signal to get IP again.

dedeckeh commented 5 years ago

But what's the difference by bringing down the interface via ifdown and later bring it up back again via ifup ? The client will also send a RELEASE and will start to request the IP address again when brought up.

mogulapranay-freescale commented 5 years ago

Almost same but instead of doing manually backend ifup and ifdown interface, want to know whether odhcp6c can handle? will close this issue

dedeckeh commented 5 years ago

The current implementation of odhcp6c cannot handle the udhcpc SIGUSR2 behavior

mogulapranay-freescale commented 5 years ago

Not an issue, need to down the interface to release ip