Skip to content

Commit b8724f7

Browse files
committed
[#80] Corrected unresolved symbol, dhcpv4o6() in relay_unittests under libtool
Removed dummy func defs, reworked #defines to satisfy symbols. Changes to be committed: modified: relay/dhcrelay.c modified: relay/tests/relay_unittests.c
1 parent 18d088f commit b8724f7

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

relay/dhcrelay.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,9 +1433,8 @@ add_relay_agent_options(struct interface_info *ip, struct dhcp_packet *packet,
14331433
return (length);
14341434
}
14351435

1436-
#ifndef UNIT_TEST
1437-
14381436
#ifdef DHCPv6
1437+
#ifndef UNIT_TEST
14391438
/*
14401439
* Parse a downstream argument: [address%]interface[#index].
14411440
*/
@@ -2020,12 +2019,14 @@ process_down6(struct packet *packet) {
20202019
if (if_id.data != NULL)
20212020
data_string_forget(&if_id, MDL);
20222021
}
2022+
#endif /* UNIT_TEST */
20232023

20242024
/*
20252025
* Called by the dispatch packet handler with a decoded packet.
20262026
*/
20272027
void
20282028
dhcpv6(struct packet *packet) {
2029+
#ifndef UNIT_TEST
20292030
struct stream_list *dp;
20302031

20312032
/* Try all relay-replies downwards. */
@@ -2048,8 +2049,9 @@ dhcpv6(struct packet *packet) {
20482049

20492050
log_info("Can't process packet from interface '%s'.",
20502051
packet->interface->name);
2052+
#endif /* UNIT_TEST */
20512053
}
2052-
#endif
2054+
#endif /* DHCPv6 */
20532055

20542056
/* Stub routines needed for linking with DHCP libraries. */
20552057
void
@@ -2147,4 +2149,3 @@ void request_v4_interface(const char* name, int flags) {
21472149
interface_snorf(tmp, (INTERFACE_REQUESTED | flags));
21482150
interface_dereference(&tmp, MDL);
21492151
}
2150-
#endif /* UNIT_TEST */

relay/tests/relay_unittests.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -406,29 +406,3 @@ ATF_TP_ADD_TCS(tp) {
406406

407407
return (atf_no_error());
408408
}
409-
410-
/* Below are dummy function definitions to satisfy "required" symbols */
411-
isc_result_t find_class (struct class **c, const char *s,
412-
const char *file, int line) {
413-
return 0;
414-
}
415-
416-
int check_collection (struct packet *packet, struct lease *lease,
417-
struct collection *collection) {
418-
return 0;
419-
}
420-
421-
void classify (struct packet *packet, struct class *class){}
422-
void bootp(struct packet *packet){}
423-
void dhcp(struct packet *packet){}
424-
void dhcpv6(struct packet *packet){}
425-
426-
int parse_allow_deny (struct option_cache **oc, struct parse *cfile,
427-
int flag) {
428-
return 0;
429-
}
430-
431-
isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
432-
control_object_state_t newstate) {
433-
return (ISC_R_SUCCESS);
434-
}

0 commit comments

Comments
 (0)