hipl-core team mailing list archive
-
hipl-core team
-
Mailing list archive
-
Message #00071
[Branch ~hipl-core/hipl/trunk] Rev 4914: fixed inconsistency in hipconf regarding manual-update
------------------------------------------------------------
revno: 4914
committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-08-25 13:43:43 +0200
message:
fixed inconsistency in hipconf regarding manual-update
hipconf would require passing of an interface as an additional parameter.
however, this information is not process in hipd afterwards. Therefore,
I removed the second parameter to the hipconf call.
modified:
lib/core/conf.c
--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk
Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'lib/core/conf.c'
--- lib/core/conf.c 2010-08-25 09:06:43 +0000
+++ lib/core/conf.c 2010-08-25 11:43:43 +0000
@@ -228,7 +228,7 @@
"transform order <integer> "
" (1=AES, 2=3DES, 3=NULL and place them to order\n"
" like 213 for the order 3DES, AES and NULL)\n"
- "manual-update <interface>\n"
+ "manual-update\n"
"nsupdate on|off\n"
"hit-to-ip on|off\n"
"hit-to-ip-zone <hit-to-ip.zone.>\n"
@@ -606,6 +606,9 @@
int count = 0;
switch (action) {
+ case ACTION_MANUAL_UPDATE:
+ count = 0;
+ break;
case ACTION_NEW:
case ACTION_NAT:
case ACTION_DEC:
@@ -615,15 +618,12 @@
case ACTION_HIT_TO_LSI:
case ACTION_MAP_ID_TO_ADDR:
case ACTION_LSI_TO_HIT:
- count = 1;
- break;
case ACTION_DEBUG:
case ACTION_RESTART:
case ACTION_REINIT:
case ACTION_NSUPDATE:
case ACTION_HIT_TO_IP:
case ACTION_HIT_TO_IP_SET:
- case ACTION_MANUAL_UPDATE:
count = 1;
break;
case ACTION_ADD:
@@ -1464,34 +1464,16 @@
* @return zero on success, or negative error value on error.
*/
static int hip_conf_handle_manual_update(hip_common_t *msg, UNUSED int action,
- const char *opt[], int optc,
+ UNUSED const char *opt[],
+ UNUSED int optc,
UNUSED int send_only)
{
- int err = 0, s = 0;
- unsigned int ifidx;
- struct ifreq ifr;
-
- HIP_IFEL(optc != 0, -1, "Too many parameters for manual-update.\n");
-
- bzero(&ifr, sizeof(ifr));
- strncpy(ifr.ifr_name, opt[0], sizeof(ifr.ifr_name));
-
- HIP_IFEL((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1, -1,
- "Failed to open socket.\n");
- HIP_IFEL(ioctl(s, SIOCGIFINDEX, &ifr) == -1, -1,
- "Failed to find interface %s.\n", opt[0]);
- ifidx = ifr.ifr_ifindex;
+ int err = 0;
HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MANUAL_UPDATE_PACKET, 0), -1,
"Failed to build user message header.: %s\n", strerror(err));
- err = hip_build_param_contents(msg, &ifidx, HIP_PARAM_UINT,
- sizeof(unsigned int));
-
out_err:
- if (s != 0) {
- close(s);
- }
return err;
}