--- net-snmp-5.4.1/perl/SNMP/SNMP.xs.orig	2008-01-10 15:13:30.621356000 -0500
+++ net-snmp-5.4.1/perl/SNMP/SNMP.xs	2008-01-10 15:14:33.269271000 -0500
@@ -1140,7 +1140,12 @@
    *response = NULL;
 retry:
 
-   status = snmp_synch_response(ss, pdu, response);
+	if(is_single(0))
+	{
+		status = snmp_sess_synch_response(ss, pdu, response);
+	} else {
+		status = snmp_synch_response(ss, pdu, response);
+	};
 
    if ((*response == NULL) && (status == STAT_SUCCESS)) status = STAT_ERROR;
 
@@ -2570,6 +2575,16 @@
     return 0;
 }
 
+/* func to track whether we're using traditional or single API functions */
+int is_single(int input)
+{
+	static int is_single = 0;
+	if(input == 1)
+	{
+		is_single = 1;
+	}
+	return is_single;
+}
 
 MODULE = SNMP		PACKAGE = SNMP		PREFIX = snmp
 
@@ -2591,7 +2606,16 @@
     CODE:
         __libraries_init(appname);
 
+int
+is_single(input)
+	int input
 
+void
+close_sess(sess_ptr)
+	SnmpSession *sess_ptr
+	CODE:
+	snmp_sess_close( sess_ptr );
+	
 SnmpSession *
 snmp_new_session(version, community, peer, lport, retries, timeout)
         char *	version
@@ -2636,7 +2660,12 @@
            session.timeout = timeout; /* 1000000L */
            session.authenticator = NULL;
 
-           ss = snmp_open(&session);
+	   if(is_single(0))
+	   {
+	           ss = snmp_sess_open(&session);
+	   } else {
+		   ss = snmp_open(&session);
+	  }
 
            if (ss == NULL) {
 	      if (verbose) warn("error:snmp_new_session: Couldn't open SNMP session");
