Specify SPIs in host byte order in xfrm code.
The result is much easier to read as it removes lots of htonl() calls. It's also more intuitive, because the SPIs seen in the code match those displayed by "ip xfrm state". It's relatively easy to do just by changing XfrmId in network byte order and fudging XfrmUsersaId. The pf_key test code also needs to be modified because it uses the xfrm code to check the results. Unfortunately we can't just fudge the pf_key SadbSa structure like we do for XfrmUsersaId because the flag bits are spread across the flags integer as opposed to being in only one byte of it. So we do have to use htonl() there. Test: xfrm tests pass on android-4.9 Change-Id: I44c9823c03a303a67514a3caee29a059dd6d0668
Loading
Please sign in to comment