AA: 6in4: backport r39646 and r40876 (#15054, #16617)


git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@40877 3c298f89-4303-0410-b956-a3cf2f4a3e73